package io.demo.message.domain.proto;

import com.google.protobuf.Message;

/**
 * Convert From POJO to Protocol Buffers Message message back and forth.
 *
 * @param <B> POJO
 * @param <M> Protocol Buffers Message
 * @author imlijinting
 */
public interface MessageConverter<B, M extends Message> {

  M toMessage(B pojo);

  B fromMessage(M message);
}
